#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
    int n;
    cin >> n;
    set<int> s;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        s.insert(x);
    }
    if (s.size() == 1)
        cout << 1 << ' ' << 0;
    else if (s.size() == 2)
        cout << 2 << ' ' << abs(*s.begin() - *(s.end()));
    else
    {
        int l;
        int sum = 0;
        for (auto e : s)
        {
            if (e == *s.begin())
                l = e;
            else
            {
                sum += e - l;
                l = e;
            }
        }
        cout << 2 << ' ' << sum;
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}